package com.sasken.pdb.controllers.events
{
	import flash.events.Event;

	/**
	 * This is a base event that passes an object when it is used. It is used for several purposes
	 * because of its ability to pass payload of any type.
	 * 
	 */ 
	public class ObjectEvent extends Event
	{
		public static var UPDATE_ON_CLOSE:String = "updateOnClose";	
		
		// the object being passed
		private var _detail:Object;

		/** 
		 * Constructor. Initializes this object.
		 * @param type See Flex documentation.
		 * @param bubbles See Flex documentation.
		 * @param cancelable See Flex documentation.
		 * @param ndetail The detail object being passed to this event. Can be anything that is readable by the event listener.
		 */ 
		public function ObjectEvent(type:String, ndetail:Object, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_detail = ndetail;
		}
		
		/**
		 *  Returns the detail object containing the required competences passed as an object.
		 *  @return The object containing the required competences passed as an object.
		 */ 
		public function get data():Object
		{
			return _detail;
		} 
			
		
	}
}